package com.tronsis.distribution.util;

import android.content.Context;
import android.text.TextUtils;

public class StateUtil {
    //VERIFY(待审核), TO_SHELVE(待上架), SHELVE(已上架), UN_SHELVE(已下架), REJECT(拒绝)
    public static final String RES_VERIFY = "VERIFY";
    public static final String RES_TO_SHELVE = "TO_SHELVE";
    public static final String RES_SHELVE = "SHELVE";
    public static final String RES_UN_SHELVE = "UN_SHELVE";
    public static final String RES_REJECT = "REJECT";

    //角色:AGENT(代理), UO_AGENT(准代理), STOCK_MAN(仓管), TRAINER(培训师)
    public static final String ROLE_AGENT = "AGENT";
    public static final String ROLE_UO_AGENT = "UO_AGENT";
    public static final String ROLE_STOCK_MAN = "STOCK_MAN";
    public static final String ROLE_TRAINER = "TRAINER";

    //升降级类型
    public static final String UPGRADE = "UPGRADE";
    public static final String DEGRADE = "DEGRADE";
    public static final String TO_AGENT = "TO_AGENT";

    //升降级申请状态 PAY(待付款), VERIFY(待审核), FINISH(已完成), REJECT(未通过)
    public static final String UPGRADE_PAY = "PAY";
    public static final String UPGRADE_VERIFY = "VERIFY";
    public static final String UPGRADE_FINISH = "FINISH";
    public static final String UPGRADE_REJECT = "REJECT";

    //退代理状态 VERIFY(待审核), HANDLE(待处理), CONFIRM(待确认), FINISH(已完成), REJECT(未通过)
    public static final String AGENT_EXIT_VERIFY = "VERIFY";
    public static final String AGENT_EXIT_HANDLE = "HANDLE";
    public static final String AGENT_EXIT_CONFIRM = "CONFIRM";
    public static final String AGENT_EXIT_FINISH = "FINISH";
    public static final String AGENT_EXIT_REJECT = "REJECT";

    //积分申请状态
    public static final String STATE_PAY = "PAY";
    public static final String STATE_CONFIRM = "CONFIRM";
    public static final String STATE_REPORT = "REPORT";
    public static final String STATE_FINISH = "FINISH";

    //积分日志  ONTRIBUTE(贡献奖励), SALES(销售奖励), WITHDRAW(提现), DELIVERY(运费抵扣), RESOURCE(素材奖励), PAY_WITHDRAW(支付下级提现), REFUND_WITHDRAW(提现超时退还), DEPOSIT_CHANGE(押金变动), PURCHASE(进货), TO_AGENT(转代理), UPGRADE(代理升级)
    public static final String LOG_CONTRIBUTE = "CONTRIBUTE";
    public static final String LOG_SALES = "SALES";
    public static final String LOG_WITHDRAW = "WITHDRAW";
    public static final String LOG_DELIVERY = "DELIVERY";
    public static final String LOG_RESOURCE = "RESOURCE";
    public static final String LOG_PAY_WITHDRAW = "PAY_WITHDRAW";
    public static final String LOG_REFUND_WITHDRAW = "REFUND_WITHDRAW";
    public static final String LOG_DEPOSIT_CHANGE = "DEPOSIT_CHANGE";
    public static final String LOG_PURCHASE = "PURCHASE";
    public static final String LOG_COUPON = "COUPON";
    public static final String LOG_TO_AGENT = "TO_AGENT";
    public static final String LOG_UPGRADE = "UPGRADE";

    //退出代理类型
    public static final String AGENT_QUIT_TYPE_RETURN = "RETURN"; //退还
    public static final String AGENT_QUIT_TYPE_DELIVERY = "DELIVERY";//发货

    //我的库存订单状态
    public static final String MY_STOCK_ORDER_PAY = "PAY";
    public static final String MY_STOCK_ORDER_VERIFY = "VERIFY";
    public static final String MY_STOCK_ORDER_FINISH = "FINISH";
    public static final String MY_STOCK_ORDER_REJECT = "REJECT";

    //我的库存订单状态
    public static final String MY_DELIVER_DELIVERY = "DELIVERY";
    public static final String MY_DELIVER_DELIVERED = "DELIVERED";

    //消息 TEAM(团队通知), ASK_PAY(补缴押金), BACKEND(后台广播), SYSTEM(系统通知), ASK_PURCHASE((我)申请进货), VERIFY_PURCHASE((我)审核进货)
    public static final String MSG_SYSTEM = "SYSTEM";
    public static final String MSG_TEAM = "TEAM";
    public static final String MSG_ASK_PAY = "ASK_PAY";
    public static final String MSG_BACKEND = "BACKEND";
    public static final String MSG_ASK_PURCHASE = "ASK_PURCHASE";
    public static final String MSG_VERIFY_PURCHASE = "VERIFY_PURCHASE";

    public static String getResSate(Context context, String state) {
        String string = "";
        switch (state) {
            case RES_VERIFY:
                string = "待审核";
                break;
            case RES_TO_SHELVE:
                string = "待上架";
                break;
            case RES_SHELVE:
                string = "已上架";
                break;
            case RES_UN_SHELVE:
                string = "已下架";
                break;
            case RES_REJECT:
                string = "未通过";
                break;
            default:

                break;
        }
        return string;
    }

    public static String getUpgradeType(Context context, String type) {
        String string = "";
        switch (type) {
            case UPGRADE:
                string = "升级";
                break;
            case DEGRADE:
                string = "降级";
                break;
            case TO_AGENT:
                string = "转代理";
                break;
            default:
                break;
        }
        return string;
    }

    public static String getUpgradeApplyState(Context context, String state) {
        String string = "";
        switch (state) {
            case UPGRADE_VERIFY:
                string = "待审核";
                break;
            case UPGRADE_PAY:
                string = "待付款";
                break;
            case UPGRADE_REJECT:
                string = "未通过";
                break;
            case UPGRADE_FINISH:
                string = "已完成";
                break;
            default:
                break;
        }
        return string;
    }

    public static String getRoleString(Context context, String role) {
        String string = "";
        switch (role) {
            case ROLE_AGENT:
                string = "代理";
                break;
            case ROLE_UO_AGENT:
                string = "准代理";
                break;
            case ROLE_STOCK_MAN:
                string = "仓管";
                break;
            case ROLE_TRAINER:
                string = "培训师";
                break;
            default:

                break;
        }
        return string;
    }

    public static String getPointsState(Context context, String state) {
        String string = "";
        switch (state) {
            case STATE_PAY:
                string = "待付款";
                break;
            case STATE_CONFIRM:
                string = "待确认";
                break;
            case STATE_REPORT:
                string = "申诉中";
                break;
            case STATE_FINISH:
                string = "已完成";
                break;
            default:
                break;
        }
        return string;
    }


    //积分日志  ONTRIBUTE(贡献奖励), SALES(销售奖励), WITHDRAW(提现), DELIVERY(运费抵扣), RESOURCE(素材奖励), PAY_WITHDRAW(支付下级提现), REFUND_WITHDRAW(提现超时退还), DEPOSIT_CHANGE(押金变动), PURCHASE(进货), TO_AGENT(转代理), UPGRADE(代理升级)
    public static String getLogState(Context context, String state) {
        String string = "";
        switch (state) {
            case LOG_CONTRIBUTE:
                string = "贡献奖励";
                break;
            case LOG_SALES:
                string = "销售奖励";
                break;
            case LOG_WITHDRAW:
                string = "提现";
                break;
            case LOG_DELIVERY:
                string = "运费抵扣";
                break;
            case LOG_RESOURCE:
                string = "素材奖励";
                break;
            case LOG_PAY_WITHDRAW:
                string = "下级提现";
                break;
            case LOG_REFUND_WITHDRAW:
                string = "提现退还";
                break;
            case LOG_DEPOSIT_CHANGE:
                string = "押金变动";
                break;
            case LOG_PURCHASE:
                string = "进货";
                break;
            case LOG_COUPON:
                string = "优惠劵积分发放";
                break;
            case LOG_TO_AGENT:
                string = "转代理";
                break;
            case LOG_UPGRADE :
                string = "代理升级";
                break;
            default:
                break;
        }
        return string;
    }


    public static String getAgentExitClearType(Context context, String state) {
        String string = "";
        switch (state) {
            case AGENT_QUIT_TYPE_RETURN:
                string = "退还库存";
                break;
            case AGENT_QUIT_TYPE_DELIVERY:
                string = "发货";
                break;
            default:
                break;
        }
        return string;
    }

    public static String getLevelText(String level) {
        if (TextUtils.isEmpty(level)) {
            return "";
        }
        String string = "";
        switch (level.toUpperCase()) {
            case "B":
                string = "省级";
                break;
            case "C":
                string = "市级";
                break;
            case "D":
                string = "县级";
                break;
            case "E":
                string = "新代理";
                break;
            default:
                break;
        }
        return string;
    }

    public static String getLevelText(String level,boolean united) {
        if (TextUtils.isEmpty(level)) {
            return "";
        }
        String string = "";
        switch (level.toUpperCase()) {
            case "B":
                if (united) {
                    string = "联创";
                } else {
                    string = "省级";
                }
                break;
            case "C":
                string = "市级";
                break;
            case "D":
                string = "县级";
                break;
            case "E":
                string = "新代理";
                break;
            default:
                break;
        }
        return string;
    }
}
